package com.fantuan.weixin.bean;

public class OutMessageText extends OutMessage{

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	private String content;

	@Override
	public String toXML() {
		
		String retStr = "";
		
		retStr += "<xml>";
		retStr += "<ToUserName><![CDATA[" + this.getToUserName() + "]]></ToUserName>";
		retStr += "<FromUserName><![CDATA[" + this.getFromUserName() + "]]></FromUserName>";
		retStr += "<CreateTime>" + this.getCreateTime() + "</CreateTime>";
		retStr += "<MsgType><![CDATA[" + this.getMsgType() +"]]></MsgType>";
		retStr += "<Content><![CDATA[" + this.getContent() + "]]></Content>";
		retStr += "</xml>";
		
		
//		Document doc = new Document("");
//		Element root = doc.appendElement("xml");
//		
//		root.appendElement("ToUserName").appendText(this.getToUserName());
//		root.appendElement("CreateTime").appendText(Long.toString(this.getCreateTime()));
//		root.appendElement("FromUserName").appendText(this.getFromUserName());
//		root.appendElement("MsgType").appendText(this.getMsgType());
//		root.appendElement("Content").appendText(this.getContent());		
//		
//		retStr = doc.html();
//		
//		retStr = StringUtils.replace(retStr, "tousername>", "ToUserName>");
//		retStr = StringUtils.replace(retStr, "createtime>", "CreateTime>");
//		retStr = StringUtils.replace(retStr, "fromusername>", "FromUserName>");
//		retStr = StringUtils.replace(retStr, "msgtype>", "MsgType>");
//		retStr = StringUtils.replace(retStr, "content>", "Content>");
		
		// TODO Auto-generated method stub
		return retStr;
	}

}
